package com.api.mc
{
	import com.game.utils.MyTimer;
	
	import flash.display.DisplayObject;
	import flash.display.LoaderInfo;
	import flash.display.Sprite;
	
	public class DisFace extends Sprite
	{
		private var _myTimer:MyTimer=new MyTimer();
		private var _faceDisTime:uint=3*1000;
		private var _faceMc:DisplayObject;
		private var _loaderInfo:LoaderInfo;
		private var _headSize:uint=50;
		public function DisFace()
		{
			super();
		}
		public function addFace(loaderInfo:LoaderInfo):void{
			delFace()
			_loaderInfo=loaderInfo;
			_faceMc=loaderInfo.content as DisplayObject;
			_faceMc.scaleX=_faceMc.scaleY=0.8;
			this.addChild(_faceMc)
			_myTimer.setTimer(delFace,_faceDisTime,1);
		}
		private function delFace():void{
			if(_faceMc!=null){
				this.removeChild(_faceMc)
				_faceMc=null;
			}
			_myTimer.gc();
		}
	}
}